fix: enhance error handling in appendToolCallStatus method#145
Conversation
jdneo
commented
May 7, 2026
There was a problem hiding this comment.
Pull request overview
Improves agent tool-call status rendering in the chat UI by ensuring error tool-call updates display meaningful text (preferring toolCall.error and falling back to progressMessage), and adds UI tests to validate the behavior.
Changes:
- Relaxed the early-return guard in
BaseTurnWidget.appendToolCallStatusto allow processing error-only tool-call updates. - Updated
errorstatus handling to set the status label text fromtoolCall.error(fallback toprogressMessage). - Added a new UI test suite covering multiple
errorstatus scenarios and overwrite behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/BaseTurnWidget.java | Adjusts tool-call status rendering to handle error-only updates and display error text reliably. |
| com.microsoft.copilot.eclipse.ui.test/src/com/microsoft/copilot/eclipse/ui/chat/BaseTurnWidgetToolCallStatusTest.java | Adds regression tests verifying error-status text rendering and replacement behavior. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/BaseTurnWidget.java:245
appendToolCallStatusnow correctly prefers a non-blankerrormessage for top-level tool calls, but therun_subagentpath still uses different fallback logic insidehandleSubagentToolCall(it checksStringUtils.isNotEmpty(toolCall.getError())and unconditionally sets that as text). This means a whitespace-onlyerrorcan still override a validprogressMessageand render as empty text for subagent failures. Consider aligninghandleSubagentToolCallwith the newisNotBlank/fallback behavior (and ideally sharing the same helper) so error text rendering is consistent for subagent and non-subagent tool calls.
String status = toolCall.getStatus().toLowerCase();
// Require a non-blank progressMessage for non-error events. For error events,
// also accept a non-blank `error` field as the displayable text.
boolean isError = "error".equals(status);
if (StringUtils.isBlank(toolCall.getProgressMessage())
&& (!isError || StringUtils.isBlank(toolCall.getError()))) {
return;
}
// Check if this is a run_subagent tool call
if ("run_subagent".equalsIgnoreCase(toolCall.getName())) {
handleSubagentToolCall(toolCall);
return;
…essage localization
Fixed in 5bc2a76 |

